package com.tiger.sso;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.jasig.cas.client.validation.Assertion;
import org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter;
import org.springframework.beans.factory.annotation.Autowired;

public class SSOProxyReceivingTicketValidationFilter extends Cas20ProxyReceivingTicketValidationFilter {

	@Autowired(required = false)
	private SSOLoginListener ssoLoginListener;
	
	protected void onSuccessfulValidation(final HttpServletRequest request, final HttpServletResponse response, final Assertion assertion) {
		super.onSuccessfulValidation(request, response, assertion);
		if(ssoLoginListener != null) {
			ssoLoginListener.loginSucc(request, response, assertion);
		}
    }
}
